<template>
  <div>
    <span v-for="(item, i) in arr" :key="i">
      <input type="checkbox" :value="item" v-model="newArr" />{{ item }}
    </span>
    <div> 合计:{{ count }}</div>

  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: [9, 15, 19, 25, 29, 31, 48, 57, 62, 79, 87],
      newArr: [],
    };
  },
  computed: {
      count(){
      return this.newArr.reduce((sum,val)=>sum+val,0)
    }
  },
  methods: {},
};
</script>

<style scoped></style>
